package day01;

import callback.ResultSetExtractor;

import java.sql.ResultSet;

public class UserResultSetExtractor implements ResultSetExtractor<User> {
    @Override
    public User extractData(ResultSet rs) throws Exception {
        User user=null;
        if(rs.next()){
            user=new User();
            user.setId(rs.getInt("id"));
            user.setName(rs.getString("name"));
        }
        return user;
    }
}
